/*
	© Simone Esposito - 2013
*/

using UnityEngine;
using System.Collections;

public class GameController : MonoBehaviour {

	// camera management
	public Camera[] cameras;
	private int selectedCam = 0;
	
	void OnGUI () {
		// print game info on GUI
		GUIContent str = new GUIContent("by Simone Esposito - 2013\n\nArrows / WASD: control car\nR: reset car\nC: switch camera");
		if (Application.platform == RuntimePlatform.WindowsPlayer)
			str.text += "\nESC: quit";
    	GUI.Label (new Rect (10, 10, 180, 120), str);
	}
	
	void Update () {
		// switch cameras
		if (Input.GetButtonDown("SwitchCam")) {
			for (int i=0; i<cameras.Length; i++)
				cameras[i].depth = -1;
			selectedCam = (selectedCam+1) % cameras.Length;
			cameras[selectedCam].depth = 0;
		}
		
		// quit game
		if (Input.GetKeyDown(KeyCode.Escape))
			Application.Quit();
	}
}
